import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("permission_role_pkey", ["id"], { unique: true })
@Entity("permission_role", { schema: "public" })
export class PermissionRole {
  @PrimaryGeneratedColumn({ type: "integer", name: "id" })
  id: number;

  @Column("integer", { name: "creator_id", default: () => "0" })
  creatorId: number;

  @Column("character varying", {
    name: "name",
    length: 30,
    default: () => "''",
  })
  name: string;

  @Column("int2", { name: "menus", nullable: true, array: true })
  menus: number[] | null;

  @Column("character varying", {
    name: "remark",
    length: 100,
    default: () => "''",
  })
  remark: string;

  @Column("boolean", { name: "enable", default: () => "false" })
  enable: boolean;

  @Column("smallint", { name: "sort", default: () => "0" })
  sort: number;

  @Column("integer", { name: "create_time", default: () => "0" })
  createTime: number;
}
